package com.trickytriads.actions
{
	import com.trickytriads.events.GetPlayerDataEvent;
	import com.trickytriads.services.interfaces.I_PlayerService;
	
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;

	/**
	 * Controller class for GetPlayerDataEvent events.
	 */
	public class GetPlayerDataAction extends EventDispatcher
	{
		[Inject]
		public var service:I_PlayerService;
		
		public function GetPlayerDataAction(target:IEventDispatcher=null)
		{
			super(target);
		}
		
		/**
		 * Event handler for getPlayerDataRequest events.
		 */
		[MessageHandler(selector="getPlayerDataRequest")]
		public function getPlayerDataRequestHandler	(evt:GetPlayerDataEvent)
		{
			service.getPlayerById(evt._player_id);
		}
		
	}
}